package com.zbl.zblproject.erp.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zbl.zblproject.erp.entity.ErpTempOrderItem;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author youlanqiang
 * @version 1.0
 * @date 2018/10/11
 */
@Repository
public interface ErpTempOrderItemMapper extends BaseMapper<ErpTempOrderItem> {


    /**
     * 根据订单ID来查询出订单的所有订单商品
     * @param orderId
     * @return
     */
    List<ErpTempOrderItem> listByOrderItem(int orderId);

    List<ErpTempOrderItem> listByOrderItemNotDesc(int orderId);


    List<ErpTempOrderItem> listBySupIdAndOrderSn(@Param("orderSns") List<String> orderSn,
                                           @Param("id") int suppliersId);

    List<ErpTempOrderItem> listBySupIdAndOrderSnAll(@Param("orderSns") List<String> orderSn,
                                                 @Param("id") int suppliersId);

    List<ErpTempOrderItem> listBySupIdAndOrderSnIsPurZero(@Param("orderSns") List<String> orderSn,
                                                          @Param("id") int suppliersId);

    List<ErpTempOrderItem> listBySupIdAndOrderSnByNoPurAndNoWare(@Param("orderSns") List<String> orderSn,
                                                          @Param("id") int suppliersId);
    /**
     * 查询orderitem表没有采购的项
     * @param orderSn
     * @param suppliersId
     * @return
     */
    List<ErpTempOrderItem> listBySupIdAndOrderSnNotPur(@Param("orderSns") List<String> orderSn,
                                                 @Param("id") int suppliersId);


    List<ErpTempOrderItem> listByOrderSn(@Param("orderSns") List<String> orderSn);

}
